home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
utilitys
/
231
/
memfil13
/
memfil13.doc
< prev
next >
Wrap
Text File
|
1988-05-08
|
16KB
|
275 lines
2/29/88
MemFile 1.3 by Dan Wilga
This program and its resource file are public domain. They may be
freely distributed on the conditions that a copy of this DOC file
is included and no payment of any type (including "copying" fees)
is incurred upon the recipient of the program. No warranty is made
as to the compatibility of this program and the author cannot be
considered responsible for any loss of data which results from the
use of this program. Use it at your own risk!
| Revisions to Version 1.2:
|
| [] Several bugs in the Search feature have been fixed; previously,
| searching for a string in hexadecimal rarely worked, stopping the
| search and re-starting it when checking a file caused the
| remainder of the file to be ignored, and moving the slider to
| any position other than the start resulted in a string not being
| found. Suffice to say, it was pretty messed-up.
| [] Occasionally, when holding down the mouse button while the
| pointer rested on the grey area of the slider, the display would
| jump back and forth between two locations. This no longer
| happens.
| [] When the window is closed in the Sector Editor mode and then
| re-opened, the current sector is re-read into the buffer because
| it may have changed since the window was last open. Actually,
| the boot sector should probably be re-read too, since the user
| might have switched floppies, but maybe next version.
| [] This document was updated slightly. Changes are denoted by a "|"
| in the first column.
Revisions to Version 1.1:
[] A "Search" button has been added to define a case-sensitive ASCII
or Hexadecimal string to be search for within memory, a file, or
the medium of a disk.
[] This file has been updated with any changes denoted by a " " in
the first column.
Overview:
MemFile is a desk accessory (DA) program that allows the user to view
and edit any portion of his ST's memory, a file on any disk drive or the
individual sectors of any drive. Because it is a desk accessory, it has the
added advantage that it is available from any GEM application, so you can
easily call it up if, say for instance, you are debugging a program and you
want to make sure that it has written a file correctly without having to leave
the program you are working on. It is also a moveable window which means that
you can reposition it to another location on the screen or even click on
another open window.
The current MemFile package includes the following files:
| MEMFIL13.DOC -- You're reading it
| MEMFIL13.ACC -- The program
| MEMFIL13.RSC -- The program's resource file
Installation:
MemFile is installed just like any other DA; place the files
| MEMFIL13.ACC and MEMFIL13.RSC in the root directory of the disk drive you
normally boot from and hit the reset button on the back of your machine.
General Use:
When you select the "MemFile!" item from the desktop's menu bar, a
window appears. When you use MemFile for the first time after booting, the
program displays the contents of your machine's memory starting at the bottom
of memory (address 0). At this time you can click on either of the two buttons
on the right side of the dialog to toggle between hexadecimal or decimal
addresses. You can also click on either of the other two buttons labeled
"File" and "Sector" to switch the display to those functions.
Which ones of the other buttons are valid depends upon the mode you
are in: if you are in Memory, you can click on either the editible address in
hex or decimal, but you cannot click on any of the buttons underneath these
two without switching modes.
You can edit the information contained in the display by clicking on
either the two-digit bytes in the second column or their ASCII representation
in the third column of the display. A cursor will appear, which can be moved
with the arrow keys. When you are editing the bytes, only the 0-9, a-f
(or A-F) keys will have any effect. You can type any key, including control
characters, when editing the ASCII values. When you are done editing, hit the
Return key. A dialog asking if you want to rewrite the information will
appear. Click on "Yes" only if you are certain that the changes you have made
are correct, otherwise you may damage system memory, forcing you to re-boot
or, worse, damage important information on a disk.
Normally, the ASCII column of the display contains all the individual
characters that make up the area being viewed. The one exception to this is
the NUL character (0x00) which cannot normally be displayed. MemFile shows
a decimal point (".") in any location where a NUL should be. Please be aware
that if you attempt to edit the ASCII column, there is no way of actually
entering a true NUL character; do NOT enter a decimal point! If you want to
change a byte to a NUL, change its value in the Hex column to zero instead.
The Search Feature:
The "Search" button calls-up a dialog which allows you to search for
a string of characters within the area that is currently being displayed.
Click on either the ASCII or the Hex box, depending upon how you want to
enter the string. After you have clicked on one or the other the cursor
will appear on the field you selected, allowing you to edit the information
there. The ASCII field may contain any key that can be typed on the keyboard.
The Hex field, however, must only contain the digits 0-9 and A-F (or
lowercase a-f).
When you have finished editing the field you chose, click on the
"Done!" button at the bottom of the dialog. The search will then begin. You
should see the scroll bar move as the search progresses though, in the case
of a Memory search, the bar may not move very often.
If the string of characters is found the display will be redrawn at
the location where the string is and the location of the start of the string
will be written in the information line at the top of the window. If the
string is not found a message is displayed in the information line and the
display is returned to its previous location.
You can stop the search at any time by pressing both of the
keyboard's Shift keys simultaneously. The last location checked in the
search will be displayed.
If you want to look for the next occurence of the same string or if
you want to resume a search that was stopped, merely press the Search button
a second time. When the dialog appears, click on the "Done!" button and the
search will proceed. If no other button has been selected since Search was
invoked the first time, the search will continue from the point where it left
off. If, however, any button (including the scroll bar) has been selected
since the initial search, the new search will begin from the lowest address
on the current display. This means that the same string will be found a
second time (assuming the previous search was not stopped). To find the
next occurence, you must then activate the Search feature one more time.
When entering a string in ASCII, there is no way to include the
NUL character (ASCII zero). The only way to enter this character is by using
the Hex field and entering "00" for one of the bytes. Please also note that
when you select Search a second time after having entered a NUL, the ASCII
string will be truncated wherever the NUL appeared. The Hex representation
will remain intact.
The Memory Editor:
The memory editor can display and edit any address from zero to the
highest available location as specified by the system variable "phystop".
This location is normally just below the maximum address that can be accessed,
and depends upon how much RAM your machine has. The only time it is not just
below the top is when you have installed programs such as "reset-proof"
ramdisks which change the value of phystop. MemFile can display any address
up to 0x3FFFFE, however, you will not be able to alter any memory location
greater than the RAM capacity of your machine (normally address 0xFFFFF on a
1040ST). For this reason, whenever an address between phystop and 0x3FFFFE
is displayed, a warning message appears at the top of the window.
You can select either of the editible address fields and enter a new
value. Addresses in decimal contain only the digits 0-9 and addresses in
hexadecimal contain 0-9 and A-F (or a-f). Pressing Return causes the display
to be redrawn, starting at the new location. If the location you gave was
higher than the highest location available, the address will be moved to the
highest location.
If you want to edit a memory location in ROM, you cannot do so by
using the scroll bar because the entire area from 0x400000 to 0xF90000 is
inaccessible. Instead, you must begin by using either of the editable
address fields to enter an address from 0xFA0000 to 0xFEFFFF. The scroll bar
will then assume that the "lowest" address is actually 0xFA0000. Enter any
RAM address to switch back to that area.
In this mode, you can click on the scroll bar to the right of the
display to move up or down in 128 byte intervals. Clicking on the arrow
buttons move the address up or down 16 bytes at a time. You can also drag the
slider to a new position. Unlike the scroll bars found on Atari's desktop, you
can select any portion of this scroll bar and hold the left mouse button down
to repeat the function continuously.
The File Editor:
Whenever you select this option, the standard Atari file selector
appears. You can then select any existing file to edit.
After you have selected a file, the display will show the contents of
the file from its beginning. You can move to any location within the file
using the scroll bar and edit by clicking on the appropriate location in the
display.
You can select the editible filename field if you want to switch to
another file contained in the same directory as the previous one. This is
sometimes easier than calling up the selector, which can be done by clicking
on the "Selector..." button. If the new file is not found or it cannot be
opened for both read and write, the program will try to re-open the previous
file. If this fails, the file selector will appear once again. This time, if
the file you select is not available, you will be returned to the Memory
editor.
If you close the MemFile window or leave the GEM program you are
currently in with the window open, the file will also be closed. However, the
next time you select MemFile from the menu bar it will try to re-open the file
you were working on last. If this is file is on a floppy, you should make
sure the same floppy is still in the appropriate drive. Please note that
this also means that the system considers a file to be open as long as you
are in the File mode. If you want to be able to access the file from any
other application, you must either leave the File option or close the MemFile
window first.
Because MemFile cannot actually increase or decrease the length of a
file, attempting to edit a zero-length file will cause an error message to be
displayed in the information line.
In this mode, clicking on the arrow keys has the same effect as
clicking on the gray area of the scroll bar, the display moves forward or
backward 128 bytes.
The Sector Editor:
When you first choose this option, the bootsector of the drive your
system was started with is displayed. Also, some statistics about the disk in
that drive are shown at the very bottom of the window.
You can switch to a new sector on the disk by clicking on either of
the + or - buttons to change the sector one at-a-time, or by clicking on the
number of sectors itself to edit it. To switch to another disk drive, select
the "Drives..." button. A dialog containing the valid drives in boldface will
appear. Click on any of the active drives to begin editing sectors on that
disk. If MemFile encounters any problem when reading or writing a sector, it
will return you to the Memory editor.
The "Swap Disks" button forces the program to re-read the bootsector
of the active drive. This is useful when switching disks in a floppy drive.
If you do not use this function (or re-select the current drive from the
Drives menu) the program may try to access a sector on the disk which does
not exist, causing an error.
MemFile always tries to read the "boot sector" of the disk whenever a
new disk is inserted or a new drive is selected. If it cannot read the boot
sector, the program displays an error message and displays the Drives list
so you can either insert a disk whose boot sector is good, or switch to
another drive alltogether.
Here, the scroll bar can be used to move the display throughout a
given sector.
Comments:
Note that the scroll bar in File Editing mode only moves in increments
of 128 bytes. This is due to the the small buffer that MemFile uses. How else
do you think this thing can get away with only using 32k??
This program has been tested with disks of various tracks/side and
sectors/track with no visible problem, however using it to read sector sizes
larger than 512 bytes (not that there are many around) is not recommended,
since that would most certainly exceed the buffer and begin overwriting other
portions of the program.
The program has also been tested with Mega ST's, both with and
without the blitter turned-on. The speed increase is rather unnoticible, but
the program seems to work correctly with the new ROMs.
Error messages appear on the name bar at the top of the window and
are accompanied by a bell. They disappear after five seconds of inactivity.
For some reason, the memory locations between the highest RAM address
and 0x3FFFFF do weird things. If you try to edit the locations, some of the
bytes appear to change just by moving the cursor over them. This is because
MemFile is somehow fed conflicting information when displaying and beginning
the edit. Don't worry about it, you can't change these locations anyway and
they really are quite useless. They just sit there and look nice.
This program works only in medium and high resolution for obvious
reasons. Booting in low-rez will cause an error message to appear, however
even though the program does not run, it is still in memory just sitting
there doing nothing. Thought you might like to know where that memory is
disappearing to.
The Search feature can be rather slow. This is mostly because every
single byte in the area must be examined -- it took 1/2 hour to scan an
entire double-sided floppy. This really cannot be avoided, sorry.
If you have any comments or suggestions please feel free to send
them to either of the addresses below. A source listing is also available
by sending a check or money order for $5 (can't get much cheaper) made
out in my name, or free (!!) through the net.
Gribnif@UMASS.Bitnet
Gribnif%UMASS.Bitnet@Forsythe.Stanford.EDU
Dan Wilga
28 Chmura Rd
Hadley, MA 01035